/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package doan.quanlycanbo.portlet.service.persistence;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.service.ServiceContext;

import doan.quanlycanbo.portlet.model.ngachluong;

import java.util.List;

/**
 * The persistence utility for the ngachluong service. This utility wraps {@link ngachluongPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
 *
 * <p>
 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
 * </p>
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author Nguyen Tuan Vinh
 * @see ngachluongPersistence
 * @see ngachluongPersistenceImpl
 * @generated
 */
public class ngachluongUtil {
	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
	 */
	public static void clearCache() {
		getPersistence().clearCache();
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
	 */
	public static void clearCache(ngachluong ngachluong) {
		getPersistence().clearCache(ngachluong);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
	 */
	public long countWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().countWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
	 */
	public static List<ngachluong> findWithDynamicQuery(
		DynamicQuery dynamicQuery) throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
	 */
	public static List<ngachluong> findWithDynamicQuery(
		DynamicQuery dynamicQuery, int start, int end)
		throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
	 */
	public static List<ngachluong> findWithDynamicQuery(
		DynamicQuery dynamicQuery, int start, int end,
		OrderByComparator orderByComparator) throws SystemException {
		return getPersistence()
				   .findWithDynamicQuery(dynamicQuery, start, end,
			orderByComparator);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
	 */
	public static ngachluong remove(ngachluong ngachluong)
		throws SystemException {
		return getPersistence().remove(ngachluong);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
	 */
	public static ngachluong update(ngachluong ngachluong, boolean merge)
		throws SystemException {
		return getPersistence().update(ngachluong, merge);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
	 */
	public static ngachluong update(ngachluong ngachluong, boolean merge,
		ServiceContext serviceContext) throws SystemException {
		return getPersistence().update(ngachluong, merge, serviceContext);
	}

	/**
	* Caches the ngachluong in the entity cache if it is enabled.
	*
	* @param ngachluong the ngachluong to cache
	*/
	public static void cacheResult(
		doan.quanlycanbo.portlet.model.ngachluong ngachluong) {
		getPersistence().cacheResult(ngachluong);
	}

	/**
	* Caches the ngachluongs in the entity cache if it is enabled.
	*
	* @param ngachluongs the ngachluongs to cache
	*/
	public static void cacheResult(
		java.util.List<doan.quanlycanbo.portlet.model.ngachluong> ngachluongs) {
		getPersistence().cacheResult(ngachluongs);
	}

	/**
	* Creates a new ngachluong with the primary key. Does not add the ngachluong to the database.
	*
	* @param mabangngachluong the primary key for the new ngachluong
	* @return the new ngachluong
	*/
	public static doan.quanlycanbo.portlet.model.ngachluong create(
		long mabangngachluong) {
		return getPersistence().create(mabangngachluong);
	}

	/**
	* Removes the ngachluong with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param mabangngachluong the primary key of the ngachluong to remove
	* @return the ngachluong that was removed
	* @throws doan.quanlycanbo.portlet.NoSuchngachluongException if a ngachluong with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.ngachluong remove(
		long mabangngachluong)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchngachluongException {
		return getPersistence().remove(mabangngachluong);
	}

	public static doan.quanlycanbo.portlet.model.ngachluong updateImpl(
		doan.quanlycanbo.portlet.model.ngachluong ngachluong, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().updateImpl(ngachluong, merge);
	}

	/**
	* Finds the ngachluong with the primary key or throws a {@link doan.quanlycanbo.portlet.NoSuchngachluongException} if it could not be found.
	*
	* @param mabangngachluong the primary key of the ngachluong to find
	* @return the ngachluong
	* @throws doan.quanlycanbo.portlet.NoSuchngachluongException if a ngachluong with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.ngachluong findByPrimaryKey(
		long mabangngachluong)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchngachluongException {
		return getPersistence().findByPrimaryKey(mabangngachluong);
	}

	/**
	* Finds the ngachluong with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param mabangngachluong the primary key of the ngachluong to find
	* @return the ngachluong, or <code>null</code> if a ngachluong with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.ngachluong fetchByPrimaryKey(
		long mabangngachluong)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByPrimaryKey(mabangngachluong);
	}

	/**
	* Finds all the ngachluongs where groupId = &#63; and languageId = &#63;.
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @return the matching ngachluongs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.ngachluong> findByG_L(
		long groupId, java.lang.String languageId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByG_L(groupId, languageId);
	}

	/**
	* Finds a range of all the ngachluongs where groupId = &#63; and languageId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @param start the lower bound of the range of ngachluongs to return
	* @param end the upper bound of the range of ngachluongs to return (not inclusive)
	* @return the range of matching ngachluongs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.ngachluong> findByG_L(
		long groupId, java.lang.String languageId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByG_L(groupId, languageId, start, end);
	}

	/**
	* Finds an ordered range of all the ngachluongs where groupId = &#63; and languageId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @param start the lower bound of the range of ngachluongs to return
	* @param end the upper bound of the range of ngachluongs to return (not inclusive)
	* @param orderByComparator the comparator to order the results by
	* @return the ordered range of matching ngachluongs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.ngachluong> findByG_L(
		long groupId, java.lang.String languageId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByG_L(groupId, languageId, start, end, orderByComparator);
	}

	/**
	* Finds the first ngachluong in the ordered set where groupId = &#63; and languageId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the first matching ngachluong
	* @throws doan.quanlycanbo.portlet.NoSuchngachluongException if a matching ngachluong could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.ngachluong findByG_L_First(
		long groupId, java.lang.String languageId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchngachluongException {
		return getPersistence()
				   .findByG_L_First(groupId, languageId, orderByComparator);
	}

	/**
	* Finds the last ngachluong in the ordered set where groupId = &#63; and languageId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the last matching ngachluong
	* @throws doan.quanlycanbo.portlet.NoSuchngachluongException if a matching ngachluong could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.ngachluong findByG_L_Last(
		long groupId, java.lang.String languageId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchngachluongException {
		return getPersistence()
				   .findByG_L_Last(groupId, languageId, orderByComparator);
	}

	/**
	* Finds the ngachluongs before and after the current ngachluong in the ordered set where groupId = &#63; and languageId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param mabangngachluong the primary key of the current ngachluong
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the previous, current, and next ngachluong
	* @throws doan.quanlycanbo.portlet.NoSuchngachluongException if a ngachluong with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.ngachluong[] findByG_L_PrevAndNext(
		long mabangngachluong, long groupId, java.lang.String languageId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchngachluongException {
		return getPersistence()
				   .findByG_L_PrevAndNext(mabangngachluong, groupId,
			languageId, orderByComparator);
	}

	/**
	* Finds the ngachluong where mangachluong = &#63; or throws a {@link doan.quanlycanbo.portlet.NoSuchngachluongException} if it could not be found.
	*
	* @param mangachluong the mangachluong to search with
	* @return the matching ngachluong
	* @throws doan.quanlycanbo.portlet.NoSuchngachluongException if a matching ngachluong could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.ngachluong findByMaNgachLuong(
		long mangachluong)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchngachluongException {
		return getPersistence().findByMaNgachLuong(mangachluong);
	}

	/**
	* Finds the ngachluong where mangachluong = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param mangachluong the mangachluong to search with
	* @return the matching ngachluong, or <code>null</code> if a matching ngachluong could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.ngachluong fetchByMaNgachLuong(
		long mangachluong)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByMaNgachLuong(mangachluong);
	}

	/**
	* Finds the ngachluong where mangachluong = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param mangachluong the mangachluong to search with
	* @return the matching ngachluong, or <code>null</code> if a matching ngachluong could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.ngachluong fetchByMaNgachLuong(
		long mangachluong, boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .fetchByMaNgachLuong(mangachluong, retrieveFromCache);
	}

	/**
	* Finds all the ngachluongs.
	*
	* @return the ngachluongs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.ngachluong> findAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll();
	}

	/**
	* Finds a range of all the ngachluongs.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of ngachluongs to return
	* @param end the upper bound of the range of ngachluongs to return (not inclusive)
	* @return the range of ngachluongs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.ngachluong> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end);
	}

	/**
	* Finds an ordered range of all the ngachluongs.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of ngachluongs to return
	* @param end the upper bound of the range of ngachluongs to return (not inclusive)
	* @param orderByComparator the comparator to order the results by
	* @return the ordered range of ngachluongs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.ngachluong> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end, orderByComparator);
	}

	/**
	* Removes all the ngachluongs where groupId = &#63; and languageId = &#63; from the database.
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByG_L(long groupId, java.lang.String languageId)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByG_L(groupId, languageId);
	}

	/**
	* Removes the ngachluong where mangachluong = &#63; from the database.
	*
	* @param mangachluong the mangachluong to search with
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByMaNgachLuong(long mangachluong)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchngachluongException {
		getPersistence().removeByMaNgachLuong(mangachluong);
	}

	/**
	* Removes all the ngachluongs from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public static void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeAll();
	}

	/**
	* Counts all the ngachluongs where groupId = &#63; and languageId = &#63;.
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @return the number of matching ngachluongs
	* @throws SystemException if a system exception occurred
	*/
	public static int countByG_L(long groupId, java.lang.String languageId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByG_L(groupId, languageId);
	}

	/**
	* Counts all the ngachluongs where mangachluong = &#63;.
	*
	* @param mangachluong the mangachluong to search with
	* @return the number of matching ngachluongs
	* @throws SystemException if a system exception occurred
	*/
	public static int countByMaNgachLuong(long mangachluong)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByMaNgachLuong(mangachluong);
	}

	/**
	* Counts all the ngachluongs.
	*
	* @return the number of ngachluongs
	* @throws SystemException if a system exception occurred
	*/
	public static int countAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countAll();
	}

	public static ngachluongPersistence getPersistence() {
		if (_persistence == null) {
			_persistence = (ngachluongPersistence)PortletBeanLocatorUtil.locate(doan.quanlycanbo.portlet.service.ClpSerializer.SERVLET_CONTEXT_NAME,
					ngachluongPersistence.class.getName());
		}

		return _persistence;
	}

	public void setPersistence(ngachluongPersistence persistence) {
		_persistence = persistence;
	}

	private static ngachluongPersistence _persistence;
}